﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using Microsoft.Xna.Framework;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace Oroboros.Save_Data
{
    public class MapSaveData : INotifyPropertyChanged
    {
        private Vector2 _BasePosition = Vector2.Zero;
        private ObservableCollection<Mission> _Missions = new ObservableCollection<Mission>();

        public Vector2 BasePosition { get { return _BasePosition; } set { Changed("BasePosition"); _BasePosition = value; } }
        public ObservableCollection<Mission> Missions { get { return _Missions; } set { Changed("Missions"); _Missions = value; } }

        public event PropertyChangedEventHandler PropertyChanged;
        public void Changed(string n)
        {
            if (PropertyChanged == null) return;
            if (!string.IsNullOrEmpty(n))
                PropertyChanged(this, new PropertyChangedEventArgs(n));
        }

        public class Mission
        {
            private Vector2 _Position;
            private MissionType _RumorType;

            public Vector2 Position { get { return _Position; } set { Changed("Position"); _Position = value; } }
            public MissionType RumorType { get { return _RumorType; } set { Changed("RumorType"); _RumorType = value; } }

            public event PropertyChangedEventHandler PropertyChanged;
            public void Changed(string n)
            {
                if (PropertyChanged == null) return;
                if (!string.IsNullOrEmpty(n))
                    PropertyChanged(this, new PropertyChangedEventArgs(n));
            }
        }

    }
}
